package cn.imu;

import cn.imu.config.SpringConfig;
import cn.imu.impl.MoAttack;
import org.junit.jupiter.api.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class testSpringIoc {

    //实现方式2：使用xml方式
    @Test
    public void DirectorXML(){
        ApplicationContext context=new ClassPathXmlApplicationContext("bean2.xml");
        MoAttack moAttack=context.getBean("moAttack2",MoAttack.class);
        moAttack.cityGateAsk();
        System.out.println(moAttack);
    }

}
